import {
  BwRouterNavMenuTypeEnum,
  BwRouterCustomComSetupTypeEnum,
} from '@/enums/routerMeta'

import type { RouteRecordRaw } from 'vue-router'

export const designRouter: Array<RouteRecordRaw> = [
  {
    path: '/layouts',
    name: 'layouts',
    component: () => import('@/views/layouts/index.vue'),
    meta: {
      isPublic: true,
      ignoreAuth: true,
    },
    children: [
      {
        path: '/:appId/customComDesign/:pageId',
        name: 'CustomComDesign',
        component: () => import('@/views/design/index.vue'),
        meta: {
          isPublic: true,
          ignoreAuth: true,
          navMenuKey: BwRouterNavMenuTypeEnum.customComDesign,
        },
      },
      {
        path: '/:appId/customComSetup/:pageId',
        name: 'CustomComSetup',
        component: () => import('@/views/pageSetup/index.vue'),
        redirect: (to) => to.fullPath + '/base',
        meta: {
          isPublic: true,
          ignoreAuth: true,
          navMenuKey: BwRouterNavMenuTypeEnum.customComSetup,
        },
        children: [
          {
            path: 'base',
            name: 'PageSetup_BaseInfo',
            component: () => import('@/views/pageSetup/views/base/index.vue'),
            meta: {
              isPublic: true,
              ignoreAuth: true,
              subMenuKey: BwRouterCustomComSetupTypeEnum.base,
              navMenuKey: BwRouterNavMenuTypeEnum.customComSetup,
            },
          },
        ],
      },
    ],
  },
]
